<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Category extends Model
{
  use SoftDeletes;

  public function articles()
  {
    return $this->hasMany('App\Article');
  }

  public static function findByNamme($name)
  {
    if( $category = self::where("name",$name) ){
      return $category;
    } else {
      return false;
    }
  }
}
